import request from "../../../utils/request"

// 根据角色id获取权限菜单
export function getMenuByRoleId(obj) {
	return request({
		url: `/admin/demo-menu/getMenuByRoleId`,
		method: "GET",
		params: obj,
	})
}

// 查询菜单
export function findAllMenu() {
	return request({
		url: `/admin/demo-menu/tree`,
		method: "post",
	})
}

// 保存菜单
export function saveMenu(obj) {
	return request({
		url: `/admin/demo-menu/save`,
		method: "post",
		data: JSON.stringify(obj),
	})
}

// 更新菜单
export function updateMenu(obj) {
	return request({
		url: `/admin/demo-menu/update`,
		method: "post",
		data: JSON.stringify(obj),
	})
}

// 根据id删除菜单
export function deleteMenu(id) {
	return request({
		url: `/admin/demo-menu/delete/` + id,
		method: "post",
	})
}
